home *** CD-ROM | disk | FTP | other *** search
/ Aminet 28 / Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso / Aminet / comm / tcp / rxsocket.lha / rxsocket / examples / interface.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1998-10-27  |  1.6 KB  |  60 lines

  1. /*
  2.     HOW TO QUERY INTERFACES
  3. */
  4.  
  5. if ~show("L","rexxsupport.library") then
  6.     if ~addlib("rexxsupport.library",0,-30) then do
  7.         say "no rexxsupport.library"
  8.         exit
  9.     end
  10. if ~show("L","rxsocket.library") then
  11.     if ~addlib("rxsocket.library",0,-30) then do
  12.         say "no rxsocket.library"
  13.     exit
  14. end
  15. if ~show("L","rmh.library") then
  16.     if ~addlib("rmh.library",0,-30) then do
  17.         say "no rmh.library"
  18.         exit
  19.     end
  20.  
  21. res=QueryInterfaces("IN")
  22. if res<0 then do
  23.     say "cannot query ("errno()")"
  24.     exit
  25. end
  26. if res==0 then do
  27.     say "no interface (?)"
  28.     exit
  29. end
  30.  
  31. say "Found:" res "interface(s)"
  32. do i=0 to res-1
  33.     say "---------------"i+1"---------------"
  34.     say "Name:  " in.i.NAME
  35.     say "AFAddr:" in.i.IFADDRS
  36.     if in.i.PPADDR~="" then say "PPAddr:" in.i.PPADDR
  37.     if in.i.BADDR~="" then say "Baddr: " in.i.BADDR
  38.     if in.i.NMASK~="" then say "NMask: " in.i.NMASK
  39.     if in.i.METRIC~="" then say "Metric:" in.i.METRIC
  40.     if in.i.MTU~="" then say "MTU:   " in.i.MTU
  41.     if in.i.IFWIRE~="" then say "IFWire:" in.i.IFWIRE
  42.     say "Flags: " in.i.FLAGS":"
  43.     if in.i.UP then say " UP"
  44.     if in.i.BROADCAST then say " BROADCAST"
  45.     if in.i.DEBUG then say " DEBUG"
  46.     if in.i.LOOPBACK then say " LOOPBACK"
  47.     if in.i.POINTTOPOINT then say " POINTTOPOINT"
  48.     if in.i.NOTRAILERS then say " NOTRAILERS"
  49.     if in.i.RUNNING then say " RUNNING"
  50.     if in.i.NOARP then say " NOARP"
  51.     if in.i.PROMISC then say " PROMISC"
  52.     if in.i.ALLMULTI then say " ALLMULTI"
  53.     if in.i.OACTIVE then say " OACTIVE"
  54.     if in.i.SIMPLEX then say " SIMPLEX"
  55.     if in.i.LINK0 then say " LINK0"
  56.     if in.i.LINK1 then say " LINK1"
  57.     if in.i.LINK2 then say " LINK2"
  58.     if in.i.MULTICAST then say " MULTICAST"
  59. end
  60.